home *** CD-ROM | disk | FTP | other *** search
- /* textrange (file, startline, numlines)
-
- Converts startline and numlines to startbyte and numbytes using
- the textrange program, displays the requested range, and posts the
- byte parameters with 'say'.
- */
-
-
- address command 'HB_Samples:hbk/textrange >ram:range' arg(1) arg(2) arg(3)
-
- if open(fr, 'ram:range', 'r') then do
- line = readln(fr)
- call close(fr)
-
- parse var line '=' start ',' . '=' amt '.'
-
- start = substr(start, 2)
- amt = substr(amt, 2)
-
- if (length(start) ~= 0) & (amt > 0 | amt = -1) then
- call showtextrange(arg(1), start, amt)
-
- say 'start byte:' start
- say 'byte count:' amt
- address command delete 'ram:range'
-
- end
-
- else
- say 'textrange program failed'
-